package com.ybn.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("vote_subject")
public class VoteSubject implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId( value = "VS_ID",type = IdType.AUTO)
    private int vsid;

    @TableField("VS_TITLE")
    private String vstitle;

    @TableField("VS_TYPE")
    private int vstype;

    /**
     * 一个投票主题对应多个投票选项
     */
    @TableField(exist = false)
    private List<VoteOption> options = new ArrayList<>();

    /**
     * 一个投票主题对应多个投票结果
     */
    @TableField(exist = false)
    private List<VoteItem> items = new ArrayList<>();
}
